package com.taobao.wolfwolf.hibernate.service.impl;

import java.util.List;

import com.taobao.wolfwolf.hibernate.dao.ComposeColorDao;
import com.taobao.wolfwolf.hibernate.pojo.Color;
import com.taobao.wolfwolf.hibernate.pojo.ComposeColor;
import com.taobao.wolfwolf.hibernate.service.ComposeColorService;

/**
 * @author Tux
 *
 * 创建时间: 2011-4-29 上午09:55:17
 */
public class ComposeColorServiceImpl extends BaseServiceImpl implements ComposeColorService {
	private ComposeColorDao cdao;
	
	public List<ComposeColor> findAll() {
		try {
			return cdao.findAll();
		} catch(Exception e) {
			e.printStackTrace();
		}
		return null;
	}

	public ComposeColor findById(int id) {
		try {
			return cdao.findById(id);
		} catch (Exception e) {
			e.printStackTrace();
			System.out.println("Error at findById(int id)");
		}
		return null;
	}


	public long getTotal()  {
		try {
			return cdao.getTotal();
		}  catch (Exception e) {
			e.printStackTrace();
			System.out.println("Error at getTotal()");
		}
		return -1;
	}

	public List<ComposeColor> paging(int page, int limit)  {
		try {
			return cdao.paging(page, limit);
		}  catch (Exception e) {
			e.printStackTrace();
			System.out.println("Error at paging(int page, int limit)");
		}
		return null;
	}

	public ComposeColorDao getCdao() {
		return cdao;
	}

	public void setCdao(ComposeColorDao cdao) {
		this.cdao = cdao;
	}

	@Override
	public ComposeColor findColor(Color color) {
		return cdao.findColor(color);
	}
}
